home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / make-367.lha / make-3.67 / build.sh.in < prev    next >
Text File  |  1993-03-28  |  2KB  |  68 lines

  1. #!/bin/sh
  2.  
  3. # Shell script to build GNU Make in the absence of any `make' program.
  4.  
  5. # Copyright (C) 1993 Free Software Foundation, Inc.
  6. # This file is part of GNU Make.
  7. # GNU Make is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11. #
  12. # GNU Make is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. # You should have received a copy of the GNU General Public License
  17. # along with GNU Make; see the file COPYING.  If not, write to
  18. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # See Makefile.in for comments describing these variables.
  21.  
  22. srcdir='@srcdir@'
  23. CC='@CC@'
  24. CFLAGS='@CFLAGS@'
  25. LDFLAGS='@LDFLAGS@'
  26. defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
  27. ALLOCA='@ALLOCA@'
  28. LOADLIBES='@LIBS@'
  29. extras='@LIBOBJS@'
  30. REMOTE='@REMOTE@'
  31.  
  32. # Common prefix for machine-independent installed files.
  33. prefix=/usr/local
  34. # Common prefix for machine-dependent installed files.
  35. exec_prefix=/usr/local
  36. # Directory to find libraries in for `-lXXX'.
  37. libdir=${exec_prefix}/lib
  38. # Directory to search by default for included makefiles.
  39. includedir=${prefix}/include
  40.  
  41. # Exit as soon as any command fails.
  42. set -e
  43.  
  44. # These are all the objects we need to link together.
  45. objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
  46.  
  47. # Compile the source files into those objects.
  48. for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
  49.   echo compiling ${file}...
  50.   $CC $CFLAGS $defines -c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
  51. done
  52.  
  53. # The object files were actually all put in the current directory.
  54. # Remove the source directory names from the list.
  55. srcobjs="$objs"
  56. objs=
  57. for obj in $srcobjs; do
  58.   objs="$objs `basename $obj`"
  59. done
  60.  
  61. # Link all the objects together.
  62. echo linking make...
  63. $CC $LDFLAGS $objs $LOADLIBES -o make.new
  64. echo done
  65. mv -f make.new make
  66.